<div class="container d-gao-80">
</div>
<div class="container">
	<div class="row">
	    <div class="col-md-8">
			<div class="d-yuanjiao-20 d-kuan">
				<!--首页海报-->
				{template "index-haibao.html"}
			</div>
			<div class="d-kuan d-buhuanhang d-beijing-baise d-bianhua-10 d-yuanjiao-10 d-waigao-20 d-wenzi-14 d-wenzi-juzhong">
				{category module=tubiao show=1 id=1 pid=0}
					{php $i=1;}
					{module module=tubiao order=displayorder catid=$t.id page=1 pagesize=$t.xingshu return=tt}
					<div class="d-kuan-25 d-quxian-0">
						<a href="{$tt.tzwz}" {if $tt.tiaozhuan ==1}target="_blank"{/if}>
							{if $tt.thumb}<img src="{dr_thumb($tt.thumb)}" width="40px" class="d-yuanjiao-10 d-img"/>{/if}
							
							<div>{$tt.title}</div>
						</a>
					</div>
					
					{if $i < 4}<div class="d-shuxian-1"></div>{/if}
					{php $i++;}
					{/module}
				{/category}
			</div>
		</div>
		<div class="col-md-4 d-yincang ">
			<div class="d-yuanjiao-10 d-kuan d-beijing-baise d-bianhua-10 d-gao-200">
				<div class="d-kuan d-buhuanhang d-xia-10">
					<div class="d-yuanjiao-20 d-kuan d-jiacu d-wenzi-16">
						站点资讯
					</div>
					<div class="d-yuanjiao-20 d-kuan-100 d-wenzi-youbian d-zitiyanse-hui d-jiacu d-wenzi-16">
						更多
					</div>
				</div>
				{php $i=1;}
				{mform module=quan form=son order=inputtime tuijian=1 return=t}
				<div class="d-hanggao-40 d-wenzi-16 d-quxian-0 d-chaochu">
					<span class="d-jiacu d-you-10 {if $i<3}d-zitiyanse-hongse{/if}">{$i}</span>
					<a href="/index.php?s=quan&c=son&id={$t.id}"> {$t.title}</a>
				</div>
				
				{php $i++;}
				{/mform}
			</div>
		</div>
	</div>
</div>

<div class="container">
	<div class="row">
		<div class="col-md-8">
			
			<div id="content_list">
			    {template "index-list-data.html"}
			</div>
			
		</div>
		<div class="col-md-4 d-yincang d-huading-300">
			<div class="d-yuanjiao-10 d-buhuanhang d-kuan d-beijing-baise d-bianhua-20 d-waigao-20 d-wenzi-juzhong">
				<div class="d-kuan-33">
					<div class="d-wenzi-16">
						{count action=table table=1_quan return=quans}
						{$quans_count}
					</div>
					<div class="d-shangxia-10">圈子</div>
					<img class="" src="static/quan/img/quan.png" height="26px">
				</div>
				<div class="d-shuxian-1-30"></div>
				<div class="d-kuan-33">
					<div class="d-wenzi-16">
						{count action=table table=1_quan_form_son return=quanties}
						{$quanties_count}
					</div>
					<div class="d-shangxia-10">帖子</div>
					<img class="" src="static/quan/img/tiezi.png" height="26px">
				</div>
				<div class="d-shuxian-1-30"></div>
				<div class="d-kuan-33">
					<div class="d-wenzi-16">
						{count action=table table=member return=members}
						{$members_count}
					</div>
					<div class="d-shangxia-10">会员</div>
					<img class="" src="static/quan/img/wo.png" height="26px">
				</div>
				
			</div>
			<div class="d-yuanjiao-10 d-kuan d-beijing-baise d-bianhua-20 d-waigao-20">
				<div class="d-yuanjiao-10 d-kuan d-beijing-baise d-bianhua-20 d-waigao-20 d-wenzi-juzhong">
					
					<form class="search-form-0" action="{SITE_MURL}index.php" method="get">
						{if dr_is_app('sou')}
						<div class="input-group">
							<input type="hidden" name="s" value="sou">
							<input type="hidden" name="c" value="home">
							<input type="hidden" name="m" value="index">
							<input type="text" class="form-control" placeholder="搜索..." name='k' value='{$_GET['k']}' id='search_keyword'>
							<span class="input-group-btn">
								<button class="btn btn-default" onclick="dr_post_comment('search_keyword')" type="submit"><i class="fa fa-search"></i></button>
							</span>
						</div><!-- /input-group -->
						{else}
						<div class="input-group">
							<input type="hidden" name="s" value="quan">
							<input type="hidden" name="c" value="sou">
							<input type="hidden" name="m" value="index">
							<input type="text" class="form-control" placeholder="搜索..." name='k' value='{$_GET['k']}' id='search_keyword'>
							<span class="input-group-btn">
								<button class="btn btn-default" onclick="dr_post_comment('search_keyword')" type="submit"><i class="fa fa-search"></i></button>
							</span>
						</div><!-- /input-group -->
						{/if}
					</form>
					<script>
					    // 这段js是用来执行搜索的
					    function dr_post_comment(name) {
					        var value = $("#"+name).val();
					        if (value) {
					            
					        } else {
								$("#"+name).focus()
								dr_cmf_tips(0, "请输入关键词");
							}
					        return false;
					    }
					</script>
				</div>
				<div class="d-kuan d-buhuanhang">
					<div class="d-yuanjiao-20 d-kuan d-jiacu d-wenzi-16">
						推荐圈子
					</div>
					
				</div>
				<div class="d-kuan">
					<div class="row">
						{module module=quan flag=1}
						    <div class="col-md-3 col-xs-3 d-waigao-20 d-quxian">
								<a href="{$t.url}">
									<div class="d-wenzi-juzhong d-yuanjiao-10">
										<img class="d-yuanjiao-20" src="{dr_thumb($t.thumb)}" height="50px"/>
										<div class="d-wenzi-juzhong d-wenzi-12 d-waigao-10">{dr_strcut($t['title'], 8, '')}</div>
									</div>
								</a>
						    </div>
						{/module}
						
					</div>
				</div>
			</div>
			<!--版权-->
			{template "index-banquan.html"}

		</div>
	</div>
</div>
<style>

</style>
<script type="text/javascript">
	//滚动显示更多
	var Mpage=1;
	var scroll_get = true;  //做个标志,不要反反复复的加载
	$(document).ready(function () {
	    $(window).scroll(function () {
	        if (scroll_get==true &&  (400 + $(window).scrollTop())>($(document).height() - $(window).height())) {
	            scroll_get = false;
	            /*layer.msg('内容加截中,请稍候',{time:1000});*/
	            dr_ajax_load_more();
	        }
	    });
	});
	function dr_ajax_load_more(){
	    Mpage++;
	    $.get('{SITE_URL}index.php?s=api&c=api&m=template&name=index-list-data.html&format=json&page='+Mpage+'&'+Math.random(),function(res){
	        $('.footer-cont').hide();
	        if(res.code==1){
	            if (res.msg.indexOf("</div>") != -1) {
	                $('#content_list').append(res.msg);
	                scroll_get = true;
	            } else {
	                layer.msg("已经显示完了",{time:500});
	            }
	        }else{
	            /*layer.msg(res.msg,{time:2500});*/
	        }
	    }, 'json');
	}
	// 模块点赞
	$(".tag_zan_list").click(function(){
	    var id = $(this).data("id");
	    $.get("{dr_url_prefix('index.php')}?s=quan&c=son&m=zanlian&id="+id, function(data){
	        dr_cmf_tips(data.code, data.msg.value + data.msg.jifen);
	        if (data.msg.value=="点赞成功") {
				$('#module_zan_list_'+id).html(data.data);
	        	 $('#tag_zan_list_'+id).html('<img src="static/quan/img/zan3.svg" width="24px" height="24px" class="d-yuanjiao-50 d-div-zuo"/>'
	        	);
	        }else{
				$('#module_zan_list_'+id).html(data.data);
	        	$('#tag_zan_list_'+id).html('<img src="static/quan/img/zan.svg" width="24px" height="24px" class="d-yuanjiao-50 d-div-zuo"/>');

	        }
	    }, 'json');
	});
	
	//关注
	$(".guanzhu_list").click(function(){
	    var id = $(this).data("id");
	    $.get("{dr_url_prefix('index.php')}?s=huiyuan&c=show&m=friend&uid="+id, function(data){
	        dr_cmf_tips(data.code, data.msg);
	        if (data.data.status==1) {
				window.location.reload();
				$('#module_guanzhu_list_'+id).html(data.data);
	        	$('#guanzhu_list_'+id).html('<div class=" d-beijing-hui d-yuanjiao-20 d-neikuang-5-10 d-div-you d-wenzi-12"><i class="fa fa-check-circle-o"></i> 已关注</div>');
				
	        }else{
				window.location.reload();
				$('#module_guanzhu_list_'+id).html(data.data);
	        	$('#guanzhu_list_'+id).html('<div class=" d-beijing-hui d-yuanjiao-20 d-neikuang-5-10 d-div-you d-wenzi-12">关 注</div>');
	            
	        }
	    }, 'json');
	});
	function dr_hy_addfriend(uid) {
		$.get("/index.php?is_ajax=1&s=huiyuan&c=show&m=friend&uid="+uid, function(json){
			dr_cmf_tips(json.code, json.msg);
			if (json.code) {
				if (json.data.status) {
					$('#hy_addfriend_'+uid).html(json.data.value);
					$('#hy_addfriend_'+uid).addClass("btn-outline");
					//window.location.href="{$url}";
					window.location.reload();
				} else {
					$('#hy_addfriend_'+uid).html("关注Ta");
					$('#hy_addfriend_'+uid).removeClass("btn-outline");
					//window.location.href="{$url}";
					window.location.reload();
				}
			}
		}, 'json');
	}
</script>